package wuziqi;
import java.util.Scanner;



// 主程序
public class ExtensibleBoardGame {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        System.out.println("选择游戏类型:");
        System.out.println("1. 井字棋 (3x3)");
        System.out.println("2. 五子棋 (15x15)");
        System.out.println("3. 自定义游戏");
        System.out.print("请输入选择 (1-3): ");
        
        int choice = scanner.nextInt();
        BoardGameEngine game;
        
        switch (choice) {
            case 1:
                game = GameFactory.createTicTacToe();
                break;
            case 2:
                game = GameFactory.createGomoku();
                break;
            case 3:
                System.out.print("请输入棋盘大小: ");
                int size = scanner.nextInt();
                System.out.print("请输入获胜所需连续棋子数: ");
                int winCount = scanner.nextInt();
                game = GameFactory.createCustomGame(size, winCount);
                break;
            default:
                System.out.println("无效选择，默认使用井字棋");
                game = GameFactory.createTicTacToe();
        }
        
        game.play();
    }
}